#include "FileReader.h"

#include <qfile.h>

FileReader1::FileReader1(QString filePath)
{
	this->filePath = filePath;
}

FileReader1::~FileReader1()
{
}

void FileReader1::run()
{
	QFile file(filePath);
	if (file.open(QFile::ReadOnly))
	{
		QByteArray data = file.readAll();
		emit signal_FileData(filePath, data);
		file.close();
	}
	else
	{
		emit signal_openFileFailed(filePath);
	}
}

FileReader::FileReader(QObject* parent ):QObject(parent)
{
}

FileReader::~FileReader()
{
}

QThreadPool* FileReader::getQThreadPool()
{
	return qThreadPool;
}
void FileReader::setQThreadPool(QThreadPool* qThreadPool)
{
	this->qThreadPool = qThreadPool;
}
